UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8txZUFtlxGQ0ztLgOxvqw4e9iR3FiJT6LBqUAN4/cHs=' 
WHERE 
  key_id = '15d2de1a9b57362a018e7018c5df0a025cf83f4b35d1e7c493671ffe98a54283' 
  AND (
    token = '8txZUFtlxGQ0ztLgOxvqw4e9iR3FiJT6LBqUAN4/cHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048