UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hhghNfvM5YjukfChmvL98Ih3J4/Yh8h4aUEjmnj0Mms=' 
WHERE 
  key_id = '382123fe6e97183a6d7c32101d028abc2cbfdf213d6cef1abd1273c2b501f797' 
  AND (
    token = 'hhghNfvM5YjukfChmvL98Ih3J4/Yh8h4aUEjmnj0Mms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073