UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sfJNky40NvcUVnaniyfGBFENANMP52cS5YKhBJYJuxY=' 
WHERE 
  key_id = '62bce2e20127a44b3aa28e0c347b6948e952d32522bd5eb5b5000db27d50cdfb' 
  AND (
    token = 'sfJNky40NvcUVnaniyfGBFENANMP52cS5YKhBJYJuxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071