UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+gFTpTyPj7XHXnM3l4rwZgP0clGVI/5VjKA70MBa5sc=' 
WHERE 
  key_id = 'a861ab2a211cafc07efc572ef45bfda5bc1a67d93f64be76a0af50e8a8fbe046' 
  AND (
    token = '+gFTpTyPj7XHXnM3l4rwZgP0clGVI/5VjKA70MBa5sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034