UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TxBcQserINA6gxTgGpbQFPApTchhqpVYzhWS/rK0pug=' 
WHERE 
  key_id = '085022ad2777a2592bf4acc21506bcf33688a53385679a55e458f185f0b1c526' 
  AND (
    token = 'TxBcQserINA6gxTgGpbQFPApTchhqpVYzhWS/rK0pug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026