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

Query time 0.00014