UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ui5fFNKQRLyWT510nG3+MJGK84U+aJ0khCT6bZP7Q3I=' 
WHERE 
  key_id = '1777f984ebe8983e8037278757453eac394081665ccfffa7718fd4a4609e1168' 
  AND (
    token = 'ui5fFNKQRLyWT510nG3+MJGK84U+aJ0khCT6bZP7Q3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045