UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wJiPgtzt2lXXwxhNfgtS1rAxJsiCZ+YAUNpE1+ZIce4=' 
WHERE 
  key_id = '7191d967bfcbd076d7ad2d2b1c064ac16f2dd5bca5144c8e6b71cbdfc5c38e8a' 
  AND (
    token = 'wJiPgtzt2lXXwxhNfgtS1rAxJsiCZ+YAUNpE1+ZIce4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031