UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h54IK2G/HpJ/qUvVdZFBoHTh1c9gi6zZdBilrFMn7YY=' 
WHERE 
  key_id = '6f72c223e6ef93542415cd0b6de1d83ac3317ed45444e89d66d054c91179ea66' 
  AND (
    token = 'h54IK2G/HpJ/qUvVdZFBoHTh1c9gi6zZdBilrFMn7YY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022