UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fp72fxB1Qyacz2XQL1DRE7kY32XSc+Z2sYQYMHt9N28=' 
WHERE 
  key_id = 'c8381f1d304305c7ed8fbf6a7c6a50749a60128a39d428d49650fdc21a45be1c' 
  AND (
    token = 'fp72fxB1Qyacz2XQL1DRE7kY32XSc+Z2sYQYMHt9N28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057