UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FqRrRFbLgazjEHOpTigRBDihy4qdM0gwH0xwjbRVGvc=' 
WHERE 
  key_id = 'b27956d4b8e3e9ae11c8b790807bb9317c8951064558347a6d4b93641aef5d5b' 
  AND (
    token = 'FqRrRFbLgazjEHOpTigRBDihy4qdM0gwH0xwjbRVGvc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025