UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EeNKBbrZ1+YubwmI/50jOLrbwnfqV+NsW7N+G2W15EA=' 
WHERE 
  key_id = '2e5355fa7c6161a78b06fdf9661cf3086a6ab2ba0102d16a1881d5581733808f' 
  AND (
    token = 'EeNKBbrZ1+YubwmI/50jOLrbwnfqV+NsW7N+G2W15EA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043