UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wpi9AAbfXhhauW1bsD1cu73qckaiqrT+Ds9QZeDTSZw=' 
WHERE 
  key_id = '9100e1a9d4be2fa4011e7119b0aff97b6ff2c5cba15a4a983941d7cf39506c46' 
  AND (
    token = 'Wpi9AAbfXhhauW1bsD1cu73qckaiqrT+Ds9QZeDTSZw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030