UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VOJI/h9xQcqJUDvBKByuUL2h0LaF+OpCCwBm2vuq9nc=' 
WHERE 
  key_id = '7cc8157a49cce94224d2c80c17171eb1be50f676cc790e53daff2591b67264e4' 
  AND (
    token = 'VOJI/h9xQcqJUDvBKByuUL2h0LaF+OpCCwBm2vuq9nc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022