UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LW1lq/VVMKZfk01uKFxi+YTHRs6Gz0LD2LGvTJtA3vg=' 
WHERE 
  key_id = '9aec139fc2e7fcd2e685dc617642c006d2b44abd6169fd22a2de465f3e915037' 
  AND (
    token = 'LW1lq/VVMKZfk01uKFxi+YTHRs6Gz0LD2LGvTJtA3vg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030