UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8xTPlkk50fBPkwiBdMymZjpsqz/GQqQHJmn/VZJ04YU=' 
WHERE 
  key_id = '4e6658cbf61944680154b5b7fee3c8ffc9af5c67724fa3846b2cef1b68132f77' 
  AND (
    token = '8xTPlkk50fBPkwiBdMymZjpsqz/GQqQHJmn/VZJ04YU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024