UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UZzx2lFVxl7Spw/53I8fSuEvW1NDyTYj7UEP7WLcMQQ=' 
WHERE 
  key_id = 'f7d63df595d0849e84d39646f3845b645e8ba2ff7909a4391438a4e8bca84cca' 
  AND (
    token = 'UZzx2lFVxl7Spw/53I8fSuEvW1NDyTYj7UEP7WLcMQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041