UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ehOFmXbKYSjyHSyMcXKHy2/ELVVxmuoRSI2Bcv9vmGI=' 
WHERE 
  key_id = '2dfbc0b31b4a2f60bd7a258c017c8c3fe0e3c00fb2874c6b14630136e17d2d79' 
  AND (
    token = 'ehOFmXbKYSjyHSyMcXKHy2/ELVVxmuoRSI2Bcv9vmGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074