UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DtyR++jYUpAa89sR8UyO2AQT7O5k+L47oNZN8P9XHDI=' 
WHERE 
  key_id = '59b89ed4f149964ab71ec73d3524871bee5058068edb458f9ed025b4b293b852' 
  AND (
    token = 'DtyR++jYUpAa89sR8UyO2AQT7O5k+L47oNZN8P9XHDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039