UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yJglAq86U6soTowTavBUid9zveMKylE02CeHSBy4d6Q=' 
WHERE 
  key_id = '0effa229d56759e80044dcfb64d1f4288ade739a11cbdd87e15bab28583c5f0a' 
  AND (
    token = 'yJglAq86U6soTowTavBUid9zveMKylE02CeHSBy4d6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029