UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pay1pdnHSWM+VR2/hj2lJWhI20BAFjcjA1e4IwxC/ic=' 
WHERE 
  key_id = 'bdecb641e8f38160f75a9ad0c72ffffc4ee7fd6faa440e5c7c2063b239b80075' 
  AND (
    token = 'pay1pdnHSWM+VR2/hj2lJWhI20BAFjcjA1e4IwxC/ic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019