UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AnMnirQw+ZTxj7zU7yrq7WMTNJGoxkS9wDqSbqzKd+s=' 
WHERE 
  key_id = '6ccc0e8bbee4ff43d9ba650cdbaecdf487cce43415aff908beefb58c9fa11b7a' 
  AND (
    token = 'AnMnirQw+ZTxj7zU7yrq7WMTNJGoxkS9wDqSbqzKd+s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019