UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QlTAwP4TuNIgo0XBBzhxu4LCJpsBX1WQYASygQx0wxg=' 
WHERE 
  key_id = '78817c06d22f9337358d48dc96ff6925c9c4a0a7e88d5864bd6c1cd0d8833317' 
  AND (
    token = 'QlTAwP4TuNIgo0XBBzhxu4LCJpsBX1WQYASygQx0wxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047