UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vtvSNL8L5RZTOnD5e/LLbrPkuOZcuuGAjnFSf9aud0o=' 
WHERE 
  key_id = '925881e7976c73b730e9d165e7e7273e70597532ccef0c32c37fb7ae677877a0' 
  AND (
    token = 'vtvSNL8L5RZTOnD5e/LLbrPkuOZcuuGAjnFSf9aud0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041