UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O3L6Zd3OvfEFpTjarMI4BpJhGsLElk+kHs5ZGZl63eg=' 
WHERE 
  key_id = '5785b62be6e9aaec6896bf6d2cf0b4632fd29bc3af561e6b44595fc79c4e5015' 
  AND (
    token = 'O3L6Zd3OvfEFpTjarMI4BpJhGsLElk+kHs5ZGZl63eg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052