UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yyeWfWoI0G3kP6gwHeoxTQgbTUw6ZYLeYWScGXTxivo=' 
WHERE 
  key_id = '0b3ff21ff56553826828eb71d71691601d71bbd55961798e0e01f39e73aff89e' 
  AND (
    token = 'yyeWfWoI0G3kP6gwHeoxTQgbTUw6ZYLeYWScGXTxivo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033