UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Xb5B1FF5i8yM7EpVNQ6T5YPTHkbhJaLE/zxXnAGLcw=' 
WHERE 
  key_id = 'f215ced184f43bc05b60b91417652a26a6ef0547c4447b9a0807dc9183f7830f' 
  AND (
    token = '7Xb5B1FF5i8yM7EpVNQ6T5YPTHkbhJaLE/zxXnAGLcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027