UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fcf7ROULbDRZfj+lVV/4ux+HLRadcJsrSvzETAB0o0U=' 
WHERE 
  key_id = '8d3e009c7aa775a921e9265b0ae17ae880584b590209c65421b0b6febd4a3436' 
  AND (
    token = 'fcf7ROULbDRZfj+lVV/4ux+HLRadcJsrSvzETAB0o0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027