UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5lwbPXqtqAlaQ/5F7i8yAVc3vI01kRtfWyqQbFwLCgo=' 
WHERE 
  key_id = '1e1bd3169a92f6cfded56744bb471005fc71b98a43b91e6f5663ae137d0738f5' 
  AND (
    token = '5lwbPXqtqAlaQ/5F7i8yAVc3vI01kRtfWyqQbFwLCgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025