UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFwLLOOpyqJpcmmLJK3pINCMJGT/SvNqKTIPXPX71bk=' 
WHERE 
  key_id = 'f9413f8a6565a71269374ac7de24adc56766c4c0118f32b56816c9980844e929' 
  AND (
    token = 'kFwLLOOpyqJpcmmLJK3pINCMJGT/SvNqKTIPXPX71bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030