UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ANduQvCZ0/8xijLbHJsjqyM+EBiwNk8j4OIMdgSu4OI=' 
WHERE 
  key_id = '69ff793c785355f607ac0851bbcfd82ec610d08454de06f9075c9a023a5bb620' 
  AND (
    token = 'ANduQvCZ0/8xijLbHJsjqyM+EBiwNk8j4OIMdgSu4OI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026