UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wCPj5IiH5n+rmlrg10fQFyYJS8YFQE3vQ3+cns2C/Wo=' 
WHERE 
  key_id = 'f39c9846483e03d67ee6d11d8aa6980d8d5c9a8f819aeb57fcedb7fdcaa4ae24' 
  AND (
    token = 'wCPj5IiH5n+rmlrg10fQFyYJS8YFQE3vQ3+cns2C/Wo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038