UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nzv5cpGf57v9zHAMU3O183BdZWain1BRbzIjzWZjTVU=' 
WHERE 
  key_id = 'c5f374d580e3af73c338dd656e67fc09a2cd38072090cd7a293dbf4c9151c459' 
  AND (
    token = 'Nzv5cpGf57v9zHAMU3O183BdZWain1BRbzIjzWZjTVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034