UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VNZPva0Z27DWanzVOMdB4RfQlhscMl2KWQZOl6pye/U=' 
WHERE 
  key_id = 'd2af3a48c93edc5b7b4d340a13541188573bbd4c6c60062efc6ea88ecbc06a71' 
  AND (
    token = 'VNZPva0Z27DWanzVOMdB4RfQlhscMl2KWQZOl6pye/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031