UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1kQAHfUaZJamdWUX85L/w33mr1wvF8eOR9dZJSKbofM=' 
WHERE 
  key_id = '2cea1628139fa9208ba0290f9bf744f4541ca9dac3196efda7ea51335b660d71' 
  AND (
    token = '1kQAHfUaZJamdWUX85L/w33mr1wvF8eOR9dZJSKbofM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043