UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6VrWHuGdPW2RaVjmL/S4mxCK2xKGDiuFz2WcuPLhH+0=' 
WHERE 
  key_id = 'bb6834055c5f59a50bf4e381092c41700328fdd93b2bfd2f573b61ae0ebf5e24' 
  AND (
    token = '6VrWHuGdPW2RaVjmL/S4mxCK2xKGDiuFz2WcuPLhH+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021