UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Rg2183//BEIMVXK0QErRVW5MzR3ar3FBQbC+NBWu0Q=' 
WHERE 
  key_id = '26115c69ad6bbeaa2786b19a266be964198555618992a98aa877b8694b539a64' 
  AND (
    token = '5Rg2183//BEIMVXK0QErRVW5MzR3ar3FBQbC+NBWu0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041