UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gFkqrHLL3uBSs1q74A2+tGsnF/2rxHB80XN9rRdzeo0=' 
WHERE 
  key_id = 'e8537c5af0b8297e5f5433331d4dcab345c8fb9f52500a1ebcb679e6dc62d92e' 
  AND (
    token = 'gFkqrHLL3uBSs1q74A2+tGsnF/2rxHB80XN9rRdzeo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030