UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zZQbLB8GVptGCkHnIyaoGQ/qALBx6FiHQgaXzgdfgc0=' 
WHERE 
  key_id = 'abdb4942b54e2093920a9fd3f72472e217b4a82bd0c14ae30185a3f8581da093' 
  AND (
    token = 'zZQbLB8GVptGCkHnIyaoGQ/qALBx6FiHQgaXzgdfgc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049