UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SkHtjK1wUp0IvzfdqksWj4PDP3HGw/UlRgX9pvfJujo=' 
WHERE 
  key_id = '4e3dcad205371dbae46993e9a02a5f0b046ffd9d31d5c6c5237e13f601b3dccd' 
  AND (
    token = 'SkHtjK1wUp0IvzfdqksWj4PDP3HGw/UlRgX9pvfJujo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032