UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Cw8448qZ8KOK2B+QBTe2HF6l+rBWeg1D/HSFln+xC0=' 
WHERE 
  key_id = 'cb4116b8d4736f48a1f31d9722f440506f143d20cbacfa65c7dd10ffeb0eb399' 
  AND (
    token = '0Cw8448qZ8KOK2B+QBTe2HF6l+rBWeg1D/HSFln+xC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048