UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M3U80P+R6G7PLxJGxb8T6DLGltdQXdDPKqV5fmbGCls=' 
WHERE 
  key_id = '6b18d25ef7ce1c83adf0842df2f2e4d99d43da2ee65932009f5aa75f3b301df0' 
  AND (
    token = 'M3U80P+R6G7PLxJGxb8T6DLGltdQXdDPKqV5fmbGCls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039