UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SSuqshu4poBPX1iFE2vt0jRQcmqatwb5YJ56KlgEFxU=' 
WHERE 
  key_id = '24d090fbdb43bdc254e01a9c0169fa4eea0653ea25abb22d40599fce6c405d35' 
  AND (
    token = 'SSuqshu4poBPX1iFE2vt0jRQcmqatwb5YJ56KlgEFxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030