UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TWHtSXsHs/zW6exSlkvzUsl3QNnYf+7aLhgchQO3IT0=' 
WHERE 
  key_id = '4f1d9f2f2b7beda9d08fe224f8ee10113c515b5184268f38fab1439206bb4675' 
  AND (
    token = 'TWHtSXsHs/zW6exSlkvzUsl3QNnYf+7aLhgchQO3IT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034