UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UIl0hO6oq4PU5LyQ7Ar5FjQC+r3DYYjgeVVreWrhTGU=' 
WHERE 
  key_id = '959b9b23b938a9ac0a7974e98ba3339767e3694b172d09ef16ed897973dc2f3e' 
  AND (
    token = 'UIl0hO6oq4PU5LyQ7Ar5FjQC+r3DYYjgeVVreWrhTGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029