UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WexxKV4/HQFUaqMzXrO4z+bbNrgIiJWlm0U2fncKII0=' 
WHERE 
  key_id = '600f64d09bd5e2dec6ef2eef2efe93e8b6443ecc9dbe8fd139b5875c54878101' 
  AND (
    token = 'WexxKV4/HQFUaqMzXrO4z+bbNrgIiJWlm0U2fncKII0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040